#include "xD3dSkin.h"

namespace XE
{

	xD3dSkin::xD3dSkin(UINT vertexCount,UINT BoneCount,LPD3DXSKININFO pDxSkin)
		:xSkin(/*vertexCount,BoneCount*/),m_pSkin(pDxSkin)
	{

	}

	xD3dSkin::~xD3dSkin()
	{
		SafeRelease(m_pSkin)
	}

	void xD3dSkin::SetSkinData(LPD3DXSKININFO pSkin)
	{
		SafeDelete(m_pSkin);
		m_pSkin = pSkin;
		return ;
	}



	UINT xD3dSkin::GetBoneCount()
	{
		if(m_pSkin!=NULL)
		{
			return  m_pSkin->GetNumBones();
			
		}
		return 0;
	}

	xString	xD3dSkin::GetBoneName(DWORD index)
	{
		if(m_pSkin==NULL)
			return xString();
		return  m_pSkin->GetBoneName(index);
	}


	const xMatrix* 	xD3dSkin::GetBoneOffsetMatrix(DWORD index)
	{
		if(m_pSkin==NULL)
			return NULL;
		return m_pSkin->GetBoneOffsetMatrix(index);
	}


}